import { LocalizationContext, MenuItem } from "../../core";

import { RenderGoToPageProps } from "./types/index";
import UpArrowIcon from "./UpArrowIcon";
import { FC, useContext } from "react";

const GoToFirstPageMenuItem: FC<RenderGoToPageProps> = ({
  isDisabled,
  onClick,
}) => {
  const l10n = useContext(LocalizationContext);
  const label =
    l10n && l10n.pageNavigation
      ? l10n.pageNavigation.goToFirstPage
      : "First page";

  return (
    <MenuItem icon={<UpArrowIcon />} isDisabled={isDisabled} onClick={onClick}>
      {label}
    </MenuItem>
  );
};

export default GoToFirstPageMenuItem;
